Previous Book Contents Book Index Next

Inside Macintosh: Programming With JManager /
Chapter 2 - JManager Reference / JManager Constants and Data Types
The Frame Object


Frame Callbacks Structure

When you create an AWT context associated with a session, you must pass a data structure that provides frame callback information. This data structure is defined by the JMFrameCallbacks data type.

struct JMFrameCallbacks {
   UInt32                      fVersion;      
   JMFrameSetupPortProcPtr     fSetupPort; 
   JMFrameRestorePortProcPtr   fRestorePort;
   JMFrameResizeRequestProcPtr fResizeRequest;
   JMFrameInvalRectProcPtr     fInvalRect;  
   JMFrameShowHideProcPtr      fShowHide;   
   JMSetTitleProcPtr           fSetTitle;     
   JMCheckUpdateProcPtr        fCheckUpdate;
};
Field Description
fVersion
The version of JManager. You should set this field to kJMVersion.
fSetupPort
A pointer to a function that sets up a graphics port. The client application must prepare a graphics port for the AWT to draw in or manipulate. This callback function has the following type definition:
               typedef void* (*JMFrameSetupPortProcPtr) (
                  JMFrameRef frame);
The value in fSetUpPort is passed to the MyRestorePort function, so this value cannot be a pointer to a stack-allocated object. For more information, see the description of the application-defined functions MySetUpPort (page 102) and MyRestorePort (page 102).
fRestorePort
A pointer to a function that restores a graphics port. This callback function has the following type definition:
               typedef void (*JMFrameRestorePortProcPtr) (
                  JMFrameRef frame, void* param);
For more information, see the description of the application-defined function MyRestorePort (page 102).
fResizeRequest
A pointer to a function that handles a frame resize request. This callback function has the following type definition:
               typedef Boolean (*JMFrameResizeRequestProcPtr) (
                  JMFrameRef frame, Rect* desired);
For more information, see the description of the application-defined function MyResizeRequest (page 103).
fInvalRect
A pointer to a function that handles a frame invalidation request. This callback function has the following type definition:
               typedef void (*JMFrameInvalRectProcPtr) (
                  JMFrameRef frame, const Rect* r);
For more information, see the description of the application-defined function MyInvalRect (page 104)
fShowHide
A pointer to a window show/hide function. This callback function has the following type definition:
               typedef void (*JMFrameShowHideProcPtr) (
                  JMFrameRef frame, Boolean showFrameRequested);
For more information, see the description of the application-defined function MyShowHide (page 104).
fSetTitle
A pointer to a function that sets the title bar text for a frame. This callback function has the following type definition:
               typedef void (*JMSetTitleProcPtr) (
                  JMFrameRef frame, Str255 title);
For more information, see the description of the application-defined function MySetTitle (page 105).
fCheckUpdate
A pointer to a function that gives the frame an opportunity to be updated during an interaction (such as a mouse drag). This callback function has the following type definition:
               typedef void (*JMCheckUpdateProcPtr) (
                  JMFrameRef frame);
For more information, see the description of the application-defined function MyCheckUpdate (page 105).

Previous Book Contents Book Index Next

© Apple Computer, Inc.
23 APR 1997